package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.UserPageQueryDto;
import com.zzyl.entity.User;
import com.zzyl.vo.UserListVo;
import com.zzyl.vo.UserVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface SysUserMapper {


    Page<UserListVo> pageQuery(UserPageQueryDto dto);

    Page<UserListVo> pageQuery2(UserPageQueryDto dto);

    @Select("select * from sys_user where email = #{email}")
    User selectByEmail(String email);

    void insert(User user);

    void update(User user);

    @Select("select * from zzyl.sys_user where id = #{userId} ")
    User selectByUserId(Long userId);

    @Delete("delete from zzyl.sys_user where id = #{userId} ")
    void deleteByUserId(Long userId);

    User selectByRealName(String realName);

    @Select("select * from sys_user where username = #{username}")
    UserVo selectByName(String username);
}
